GENERATE_WATERSHED and GENERATE_RIDGE_LINES

The GENERATE_WATERSHED command allows for the generation of a watershed, including stream flow and optionally watershed areas for each stream segment. The GENERATE_RIDGE_LINES command shares the same parameters, but finds ridge lines rather than stream lines. A ridge line is created wherever flow would accumulate in the inverse of the terrain surface. The following parameters are supported by the command.

  • FILENAME - filename of the layer(s) to process. If an empty value is passed in, all loaded terrain data will be used. This parameter can be listed more than once to specify multiple input files, like FILENAME="FILENAME_1" FILENAME="FILENAME_2".
  • STREAM_THRESHOLD - specifies the number of cells that have to drain to a particular location before that location is considered to be part of the stream/ridge network.
  • MAX_DEPTH - specifies the maximum depression depth (in meters) that will be filled prior to calculating the watershed. This is needed to prepare a terrain surface for flow analysis so that a continuous flow can be found. Note that while using a large MAX_DEPTH value may generate better results, it could also cause the process to take a lot longer.
  • GEN_AREAS - generate watershed area features for each found stream segment outlining the area that drains into that stream. Enabled by default for watersheds and disabled for ridge lines, use GEN_AREAS=NO to disable.
  • SMOOTH_STREAMS - specifies whether or not generated streams/ridge lines should have smoothing applied to improve appearance. This option is enabled by default. Use SMOOTH_STREAMS=NO to disable smoothing.
  • FLOW_TO_POS - specifies the X and Y location (or longitude/latitude) of a position to generate an area with all parts of the terrain surface that flow to (or near) that point in the vector area feature. The format is FLOW_TO_POS="x,y". You can provide multiple FLOW_TO_POS parameters to find the flow to multiple locations. Use FLOW_TO_POS_THRESH to specify how close to the position the flow has to go in order to consider the source point part of that area. Use FLOW_TO_POS_PROJ to specify the projection of the position. If that is not provided it will be assumed to be in the current projection.
  • FLOW_TO_POS_THRESH - specifies how many samples away from the sample containing the specified FLOW_TO_POS that the flow can be and still be considered to go to that point. The default is FLOW_TO_POS_THRESH=1.
  • FLOW_TO_POS_PROJ - special Projection Specification parameter providing the projection of the FLOW_TO_POS.
  • FILLED_DEM_FILENAME - specifies the full path and name of a GMG (Global Mapper Grid) file to save the depression filled DEM to after finding it. The default is to not save the filled DEM to a GMG file.
  • GEN_FLOW_DIR_POINTS - specifies whether or not a separate layer containing a point feature with the flow direction and accumulation at each sample location. Add GEN_FLOW_DIR_POINTS=YES to create the layer. The symbol can be set with the FLOW_DIR_SYMBOL parameter.
  • FLOW_DIR_SYMBOL - specifies the name of the point symbol to use for the flow direction points. The specified symbol will be rotated to show the flow direction. The default is the medium black arrow.
  • SHOW_FLOW_ACCUM - specifies whether or not the flow accumulation grid should be saved as a new layer. Use SHOW_FLOW_ACCUM=YES to enable saving the flow accumulation to a new grid layer.
  • CALC_STRAHLER - specifies whether or not the Strahler stream order attribute should be calculated for the stream lines. Use CALC_STRAHLER=YES to enable. Use only for GENERATE_WATERSHED command.
  • AUTOSTYLE_COLOR - specifies whether generated stream / ridge lines should be auto-styled to indicate the prominence/flow of the stream / ridge lines. This is enabled by default. Use AUTOSTYLE_COLOR=NO to disable.

  • Obstructions from Vector Data:
    • USE_VECTOR_HEIGHTS - indicates whether or not loaded vector data with elevation values should be considered when performing the watershed analysis. This allows you to use things like buildings, culverts, dams, etc. to block or modify the flow, creating a more realistic watershed. The default is to not use vector data. Use USE_VECTOR_HEIGHTS="YES" to specify that you want to use heights from vector data.

    • VECTOR_FILENAME - specifies the filename/description of the vector layer(s) to get obstructions from. If not provided, all loaded vector layers will be considered. You can provide multiple VECTOR_FILENAME parameters to explicitly specify multiple layers.

    • VECTOR_AREAS_HIDDEN - specifies that any locations within an obstruction area, or immediately adjacent to an obstruction line, will not allow flow into the region from outside, regardless of the height of the feature. The default is "NO".

    • VECTOR_ONLY_3D - specifies that only vector features with elevations will be considered as obstructions. By default, 2D features will also be used as obstructions. Any 2D features that are used will act as no-flow obstructions, so flow cannot enter them regardless of the VECTOR_AREAS_HIDDEN value.

    • VECTOR_HEIGHTS_ABOVE_SEA_LEVEL - specifies whether the elevation values stored with vector features are relative to the ground or relative to mean sea level. Typically heights for vector features are specified relative to the ground. If any area features are included and their heights are relative to the ground, the obstruction heights within those areas will be increased by the specified amount. Any features that have an explicit altitude mode set for the feature or layer will obey that over this settings. The default is "NO" (heights are relative to the ground). To specify that vector heights should be relative to sea level, use VECTOR_HEIGHTS_ABOVE_SEA_LEVEL="YES"

  • SPATIAL_RES - specifies spacing of grid points used to calculate the watershed. A smaller grid spacing results in higher fidelity, but the calculation process will take longer. Typically you'll want to use the default value which is the minimum spatial resolution of all loaded data. Should be formatted as x_resolution,y_resolution. The units are the units of the current global projection. For example, if UTM was the current global projection and you wanted to use a grid with a 30 meter spacing, the parameter/value pair would look like SPATIAL_RES=30.0,30.0.
  • SPATIAL_RES_METERS - specifies spatial resolution to use in meters. The value in meters will automatically be converted to the current view/export projection units. For example, to do an export at 2.0 meter spacing (or as close as you can get to that in the current units), use SPATIAL_RES_METERS=2.0, or to do an export at 1.0 meters in X by 1.5 meters in Y, use SPATIAL_RES_METERS="1.0,1.5".
  • SAMPLING_METHOD - specifies the sampling method to use when sampling the terrain layers involved in the watershed calculation. The following values are supported:
    • DEFAULT - Use either automatic resampling based on export or layer resampling, depending on setting of global flag about whether to resample on export
    • AUTO - Automatically select a resampling method based on how the export resolution and bounds compare to the original layout for a layer. For example if you export to a lower resolution a box averager of appropriate size may be used automatically
    • LAYER - Use the sampling method set for each layer
    • The list of SAMPLING_METHOD values for the IMPORT command can also be specified to use a particular sampling method for all layers being exported/
  • FILL_GAPS - specifies that small gaps in between and within the data sets being used to generate the watershed will be filled in by interpolating the surrounding data to come up with an elevation for the point in question. This option is on by default, specify FILL_GAPS=NO to turn off.
  • LAYER_DESC - specifies the name to assign to this layer. If no layer description is provided, the default name of "GENERATED WATERSHED" will be used.
  • MIN_STREAM_LEN - specifies the minimum length in meters of a stream segment at the start of a stream network. Any streams shorter than this that have nothing flowing into them will be discarded. The default is to keep all streams regardless of length.
  • KEEP_ZERO_AT_ZERO - specifies whether or not to modify 0 (typically ocean) values to allow flow to continue across expanses of 0 elevation. The default is to enable this so 0 values don't change. If you want to model flow across 0 surfaces, add KEEP_ZERO_AT_ZERO=NO.
  • MIN_ELEV - If specified, ridge lines will only be found where the elevation is greater than or equal to the MIN_ELEV value. For use with GENERATE_RIDGELINES command only.